package compound.pattern;import compound.duck.DuckCall;import compound.duck.MallardDuck;import compound.duck.RedHeadDuck;import compound.duck.RubberDuck;/** * Created by Administrator on 2018-11-8. */public class CountingDuckFactory extends AbstractDuckFactory {    public Quackable createMallardDuck() {        return new QuackCounter(new MallardDuck());    }    public Quackable createRedheadDuck() {        return new QuackCounter(new RedHeadDuck());    }    public Quackable createDuckCall() {        return new QuackCounter(new DuckCall());    }    public Quackable createRubberDuck() {        return new QuackCounter(new RubberDuck());    }}